package pre.dao;

import java.util.ArrayList;

import javax.annotation.Resource;

import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import pre.vo.commentVO;

@Repository("commDAO")
public class CommDAO {
	
	@Resource(name = "sqlMapClientTemplate")
	private SqlMapClientTemplate sqlmap;

	public ArrayList selectAllComm(String bnum) {
		return (ArrayList) sqlmap.queryForList("comm.selectCommList", bnum);
	}

	public void registerComm(commentVO c) {
		System.out.println(c.toString());
		sqlmap.insert("comm.insertComm", c);
	}

	public void updateComm(commentVO c) {
		sqlmap.update("comm.updateComm", c);
	}

	public void deleteComm(String cnum) {
		sqlmap.delete("comm.deleteComm", cnum);
	}

	
}
